package com.gs.service.predetermine;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gs.dao.PredetermineDao;
import com.gs.pojo.Predetermine;
import com.gs.utils.Page;
@Service("predetermineService")
public class PredetermineServiceImpl implements PredetermineService{
	
	@Resource
	private PredetermineDao predetermineDao;

	public List<Predetermine> selectall() {
		return predetermineDao.selectall();
	}

	public int updateRemind(Integer id) {
		return predetermineDao.updateRemind(id);
	}

	public Page<Predetermine> pageFuzzyselect(String receiveTeamName, 
											  String passengerName, 
											  int predetermineStateID,
											  Page<Predetermine> vo) {
		int start=0;
		if (vo.getCurrentPage()>1) {
			start=(vo.getCurrentPage()-1)*vo.getPageSize();
		}
		List<Predetermine> list=predetermineDao.pageFuzzyselect(receiveTeamName,passengerName, predetermineStateID, start, vo.getPageSize());
		vo.setResult(list);
		int count=predetermineDao.countFuzzyselect(receiveTeamName, passengerName, predetermineStateID);
		vo.setTotal(count);
		return vo;
	}

	public int deleteById(Integer id) {
		return predetermineDao.deleteById(id);
	}

	public int insertAll(Predetermine predetermine) {
		return predetermineDao.insertAll(predetermine);
	}

	public Predetermine findById(Integer id) {
		return predetermineDao.findById(id);
	}

	public List<Predetermine> findTeamId(int id) {
		return predetermineDao.findTeamId(id);
	}

	public List<Predetermine> findLvKeId(int id) {
		return predetermineDao.findLvKeId(id);
	}

	public int updatePredetermineStateID(int id) {
		return predetermineDao.updatePredetermineStateID(id);
	}

}
